#ifndef __APIXEL_H__
#define __APIXEL_H__

#define FULL_INT 0xffff
#define ACCUM_FULL_INT 0x7fffffff

typedef unsigned short PIXVAL;
typedef unsigned int ACCUM_PIXVAL;

class AVECTOR;

class APIXEL
{
	public:
	APIXEL( float ar, float ag, float ab );
	APIXEL( double ar, double ag, double ab );
	APIXEL( PIXVAL ar, PIXVAL ag, PIXVAL ab );
	APIXEL( const AVECTOR &src);
	APIXEL( void ) {}
	PIXVAL r,g,b;
	void diff( const APIXEL &a, const APIXEL &b );
	void addto( const APIXEL &a );
};

class ACCUM_PIXEL
{
	public:
	ACCUM_PIXVAL r,g,b;
	int samples;
};

class AHSV
{
	public:
	float h, s, v;
};

AHSV pixel_to_hsv( APIXEL src);
APIXEL hsv_to_pixel( AHSV src );

#endif

